package com.tuanzi.loan.business.service.common;

import com.tuanzi.loan.business.entity.common.CommProductChannel;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.channel.ChannelSearchRequest;
import com.tuanzi.loan.vo.response.channel.ChannelSearchResponse;
import org.primefaces.model.TreeNode;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * @author Ray 2017/10/31
 */
public interface CommProductChannelService {
	
	Integer checkRepeatChannelCode(CommProductChannel channel);

	List<CommProductChannel> findAll();

	List<CommProductChannel> findAll(List<Long> ids);

	CommProductChannel findOne(Long id);

	CommProductChannel saveOrUpdate(CommProductChannel commProductChannel);

	Page<ChannelSearchResponse> list(PageSearcher<ChannelSearchRequest> pageSearcher);

	Integer checkDuplicatedChannelCode(Integer startChannelCode, Integer endChannelCode);

	List<CommProductChannel> batchSave(List<CommProductChannel> commProductChannels);

	/**
	 * 查询当前用户（合作方账户）所关联的渠道
	 * @return
	 */
	List<CommProductChannel> findCurrentUserChannels();

	/**
	 * 生成按渠道分组的treeNode
	 * @param selectedNodeStr 已 , 分割的节点字符串，用来初始化选中， 可null
	 * @return treeNode
	 */
	TreeNode createChannelGroupTreeNode(String selectedNodeStr);
}
